import fractions
from random import random as rand0To1, randint
import math

def equationsWithPowers():
    pronumeral = randint(0, 10)
    constant = randint(0, 15)
    power = randint(2, 5)
    answer = int((pronumeral**power) + constant)

    return 'x^' + str(power) + ' + ' + str(constant) + ' = ' + str(answer), pronumeral
'''
def harderEquationsWithPowers():
    pronumeral = randint(0, 10)
    constant = randint(0, 15)
    power = randint(4, 10)
    answer = int((pronumeral**power) + constant)

    return 'x^' + str(power) + ' + ' + str(constant) + ' = ' + str(answer), pronumeral

def reallyHardEquationsWithPowers():
    pronumeral = randint(0, 10)
    constant = randint(0, 15)
    power = randint(11, 20)
    answer = int((pronumeral**power) + constant)

    return 'x^' + str(power) + ' + ' + str(constant) + ' = ' + str(answer), pronumeral


def impossiblyHardEquationsWithPowers():
    pronumeral = randint(0, 10)
    constant = randint(0, 15)
    power = randint(100, 100000)
    answer = int((pronumeral**power) + constant)

    return 'x^' + str(power) + ' + ' + str(constant) + ' = ' + str(answer), pronumeral

print equationsWithPowers()
print harderEquationsWithPowers()
print reallyHardEquationsWithPowers()
print impossiblyHardEquationsWithPowers()
'''
